Running Programs Backwards : The Logical Inversion of Imperative
نویسنده
چکیده
The feasibility of inverting imperative computations using logic programming technology is informally explored. Program inversion is the process of determining the possible input values that will produce a given output for a program. The relational semantics of imperative computations treats programs as logical relations over the observable environment, which is usually taken to be the state of the variables in memory. The declarative semantics of program relations implicitly denote both forward and inverse computations. This view of computation has practical applications when logic programming technology is considered. An imperative program has a logic program derived for it which abductively describes its inverted behaviour. Depending on the inference strategy used, execution of this relational program can compute the inverse of the imperative program. It is shown how a number of nontrivial imperative computations can be inverted with minimal logic programming tools. The advantage of this approach is that nondeterministic inversions are possible, which permits sets of inputs to be computed for a particular output. This should prove to be a useful tool in imperative program testing and debugging.
منابع مشابه
Inference of Polynomial Invariants for Imperative Programs: A Farewell to Gröbner Bases
We propose a static analysis for computing polynomial invariants for imperative programs. The analysis is derived from an abstract interpretation of a backwards semantics, and computes preconditions for equalities like g = 0 to hold at the end of execution. A distinguishing feature of the technique is that it computes polynomial loop invariants without resorting to Gröbner base computations. Th...
متن کاملFrom Runtime Verification to Evolvable Software
In [4] we developed a revision-based logical modelling approach for evolvable systems, built as hierarchical assemblies of components. A component may encapsulate horizontal compositions of interacting sub-components as well as specially paired vertical compositions of supervisor and supervisee subcomponents. Our work here extends this logical framework to incorporate programs within each compo...
متن کاملMutable Lists and Call-by-reference in Equational Logic
As the interest for formal methods grows within industry, the need for convenient and automated tools grows too. SOSSubC is an attempt to help the development of certified programs. It allows formal reasoning about imperative programs by translating programs written in SubC, a simple imperative language, into equations. Programs are then axioms of a logical system within which proofs can be car...
متن کاملObject Based Multiparadigm Concepts for Verification of Functional Components
Temporal properties are very useful for proving the correctness of (sequential or parallel) imperative (possibly object oriented) programs. In the case of the correctness of functional components, the practicability of temporal operators is not so evident. In a pure functional programming language a variable is a value and not an object that can change its value in time, viz. during program exe...
متن کاملComparison of the Effect of 6 Weeks of Balancing and Hopping Strengthening Training on the Kinematics of the Lower Extremities of Athletes with Functional Ankle Instability while Running: A Randomized Controlled Trial
Introduction: Ankle sprains are one of the most common sports injuries. This injury can affect the kinematics of the athletechr('39')s lower extremities. Therefore, the aim of this study was to compare the effect of 6 weeks of balancing and hopping strengthening training on the kinematics of the lower extremities of athletes with functional ankle instability while running. Methods: The present...
متن کامل